package cc.ccoke.swingutils.dot_matrix.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.text.DecimalFormat;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class DotMatrix implements Serializable {
    @Excel(name = "X", height = 6, width = 20)
    private Double x;
    @Excel(name = "Y", height = 6, width = 20)
    private Double y;
    @Excel(name = "Z", height = 6, width = 20)
    private Double z;

    public String getMatrix() {
        DecimalFormat df = new DecimalFormat("#.00");
        StringBuilder sb = new StringBuilder(20);
        sb.append(df.format(x));
        sb.append(",");
        sb.append(df.format(y));
        sb.append(",");
        sb.append(df.format(z));
        return sb.toString();
    }
}
